﻿<style>
    #menuListDt th{
        text-align:center;
    }
    #menuListDt td {
        text-align: center;
    }
</style>
<table id="menuListDt" class="table table-striped table-bordered" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>Sl</th>
            <th>Name</th>
            <th>Position</th>
            @if (GlobalContext.WebSite.IsMultiLangual)
            {
                <th>Language</th>
            }
            <th>Order</th>
            <th>Action | <a class="btn btn-sm btn-info" asp-controller="CmsMenu" asp-action="Index" asp-route-isManage=true><i class="fa fa-refresh"></i> </a></th>
        </tr>
    </thead>
    <tbody>
        @{ var i = 1;}
        @foreach (NccMenu item in ViewBag.MenuList)
        {
            <tr>
                <td>@i</td>
                <td>@item.Name</td>
                <td>@item.Position</td>
                @if (GlobalContext.WebSite.IsMultiLangual)
                {
                    <td>
                        @if (string.IsNullOrEmpty(item.MenuLanguage))
                        {
                            <span>All</span>
                        }
                        else
                        {
                            <span>@item.MenuLanguage</span>
                        }
                    </td>
                }
                <td>@item.MenuOrder</td>
                <td>
                    <a asp-controller="CmsMenu" asp-action="Index" asp-route-menuId="@item.Id">Edit</a> |
                    <a asp-controller="CmsMenu" asp-action="DeleteMenu" asp-route-menuId="@item.Id">Delete</a>
                </td>
            </tr>
            i++;
        }
    </tbody>
</table>